package com.hjc.service.impl;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateRange;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.hjc.db.dao.*;
import com.hjc.db.pojo.TbCheckin;
import com.hjc.db.pojo.TbImagePath;
import com.hjc.dto.SystemConstants;
import com.hjc.exception.EmosException;
import com.hjc.service.CheckinService;
import com.hjc.service.ImagePathService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service
@Scope("prototype")
@Slf4j
public class ImagePathServiceImpl implements ImagePathService {
    @Autowired
    private TbImagePathDao tbImagePathDao;

    @Override
    public void insert(HashMap param) {
        TbImagePath imagePath = new TbImagePath();
        imagePath.setUserId((Integer) param.get("userId"));
        imagePath.setImagePath((String) param.get("imagePath"));
        imagePath.setDate((String) param.get("date"));
        tbImagePathDao.insert(imagePath);
    }

    @Override
    public void delete(HashMap param) {
        tbImagePathDao.updateStatus((Integer) param.get("userId"), (String) param.get("imagePath"),
                (String) param.get("date"));
    }
}


